{% extends 'thesis_review/base.html' %}
{% load main_tags %}
{% block reviewIndex %}
	<div class="container-fluid" style="margin-top: 30px">
		<div class="col-sm-2">
			<nav class="nav-sidebar">
				<ul class="nav tabs">
					{% for key, status in status_choices %}
						<li>
							<a href="#tab{{ key }}" data-toggle="tab">
								{{ status }}
								<span class="sidebar-badge">
								{% query thesis count=True status=key %}
                      		</span>

							</a>
						</li>
					{% endfor %}
				</ul>
			</nav>

		</div>
		<!-- tab content -->
		<div class="tab-content">
			{% for key, status in status_choices %}
				<div class="tab-pane text-style" id="tab{{ key }}">
					<div class="col-sm-10">
						<table class="table">
							<thead>
							<tr>
								<th scope="col">id</th>
								<th scope="col">title</th>
								<th scope="col">author</th>
								<th scope="col">create date</th>



								{% if key != 0 %}
								<th scope="col">reviewers</th>
								{% endif %}

								{% if key == 2 %}
								<th scope="col">publish time</th>
								{% endif %}

								<th scope="col">link</th>
							</tr>
							</thead>
							<tbody>
							{% query thesis status=key as thesis_list %}
							{% for i in thesis_list %}
								<tr>

									<td>{{ i.pk }}</td>
									<td>{{ i.title }}</td>
									<td>{{ i.author }}</td>
									<td>{{ i.create_time }}</td>

									{% if key != 0 %}
										<td><p style="font-size: medium" class="lead">{% for n in i.review_set.all %}<a>{{ n.reviewer.username }}</a> &nbsp; {% endfor %}</p></td>
									{% endif %}

									{% if key == 2 %}
										<td>{{ i.publish_time }}</td>
									{% endif %}

									<td><a href="{% url 'thesisReviewById' i.pk %}">VIEW</a></td>
								</tr>
							{% endfor %}
							</tbody>
						</table>

					</div>
				</div>
			{% endfor %}
		</div>

	</div>

{% endblock %}